<template>
  <div class="modal-container">
    <div class="dialog-container">
      <span>Are you sure ?</span>
      <div class="dialog-options">
        <button size="mini" class="btn btn-success btn-fill btn-fill-left" data-text="确定">确定</button>
        <button size="mini" class="btn btn-danger btn-fill btn-fill-right" data-text="取消">取消</button>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
  .modal-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 20px;

    .dialog-container {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 200px;
      height: 180px;
      border-radius: 10px;
      background: linear-gradient(90deg, lightblue, blue);
      padding: 20px 15px;

      span {
        position: absolute;
        font-size: 1.5em;
        font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
        top: 40px;
        color: #fff;
      }

      .dialog-options {
        position: absolute;
        bottom: 40px;

        .btn {
          position: relative;
          width: 60px;
          border-radius: 20px;
          padding: 6px 10px;
          border: none;
          background: #fff;
          white-space: nowrap;
          user-select: none;

          &-danger {
            color: crimson;
            margin-left: 15px;
          }

          &-success {
            color: lawngreen;
          }

          &-fill {
            overflow: hidden;

            &-left {
              &::before {
                background: lawngreen;
                transform: translateX(100%);
              }

              &:hover {
                &::before {
                  transform: translateX(0);
                }
              }
            }

            &-right {
              &::before {
                background: crimson;
                transform: translateX(-100%);
              }

              &:hover {
                &::before {
                  transform: translateX(0);
                }
              }
            }

            &::before {
              position: absolute;
              content: "";
              top: 0px;
              left: 0px;
              width: 100%;
              height: 100%;
              border-radius: inherit;
              transition: 0.4s cubic-bezier(0.75, 0, 0.25, 1);
            }

            &::after {
              position: absolute;
              content: attr(data-text);
              top: 0px;
              left: 0px;
              width: 100%;
              height: 100%;
              padding-top:6px;
              transition: 0.4s ease;
              opacity: 0;
            }

            &:hover {
              &::after {
                opacity: 1;
                color: white !important;
              }
            }
          }
        }
      }
    }
  }
</style>
